package com.danger.Activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.TextView;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.Extra;
import org.androidannotations.annotations.ViewById;

@EActivity(R.layout.activity_second)
public class SecondActivity extends AppCompatActivity {

    /**
     * 通过@Extra标签获取到MainActivity传递过来的参数
     * 用于两个Activity参数之间的传递
     */
    @Extra(MainActivity.NAME)
    String name;
    @Extra(MainActivity.AGE)
    String age;

    @ViewById
    TextView name_textView;
    @ViewById
    TextView age_textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @AfterViews
    public void initView() {
        name_textView.setText(name);
        age_textView.setText(age);
    }
}
